home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / TELNET.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-19  |  1.2 KB  |  53 lines

  1. #ifndef    _TELNET_H
  2. #define    _TELNET_H
  3.  
  4. #ifndef _SESSION_H
  5. #include "session.h"
  6. #endif
  7.  
  8. #define    LINESIZE    256    /* Length of local editing buffer */
  9.  
  10. /* Telnet command characters */
  11. #define    IAC        255    /* Interpret as command */
  12. #define    WILL        251
  13. #define    WONT        252
  14. #define    DO        253
  15. #define    DONT        254
  16. #define CLEARSCREEN     247
  17. #define CLEARSPLIT      249
  18. #define COMPRESSED      248
  19. #define    SB        250
  20. #define    SE        240
  21.  
  22. #define TN_LINEMODE 34
  23.  
  24. #define    TS_IS        0
  25. #define    TS_SEND        1
  26.  
  27. /* Telnet options */
  28. #define    TN_TRANSMIT_BINARY    0
  29. #define    TN_ECHO            1
  30. #define    TN_SUPPRESS_GA        3
  31. #define    TN_STATUS        5
  32. #define    TN_TIMING_MARK        6
  33. #define    NOPTIONS        6
  34.  
  35. /* Telnet protocol control block */
  36. struct telnet {
  37.     char local[NOPTIONS+1];    /* Local option settings */
  38.     char remote[NOPTIONS+1];    /* Remote option settings */
  39.     struct session *session;    /* Pointer to session structure */
  40.     char eolmode;        /* Control translation of enter key */
  41. };
  42. #define    NULLTN    (struct telnet *)0
  43.  
  44. /* In telnet.c: */
  45. int tel_connect (struct session *sp,char *fsocket,int len);
  46. void tnrecv (struct telnet *tn);
  47.  
  48. /* In ttylink.c: */
  49. void ttylhandle (int s,void *unused,void *p);
  50.  
  51. #endif    /* _TELNET_H */
  52.  
  53.